/**
 * 
 */
package cn.hbu.zlfw.exchange.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

import cn.hbu.zlfw.patent.entity.Patent;

/**
* @ClassName: Chat
* @Description: 在线交流实体类
* @author tiddar
* @date 2018年8月13日
*
*/
@Entity
@Table(name="t_chat")
public class Chat {
	
	@Id
	@Column(name="id",length=32)
	@GeneratedValue(generator="UUID_KEY")
	@GenericGenerator(name="UUID_KEY",strategy="uuid.hex")
	private String id;
	private String fromUserId;
	private String fromUserType;
	
	private String content;

	
	@ManyToOne(cascade= {CascadeType.MERGE,CascadeType.PERSIST})	//级联策略
	@JoinColumn(name="patent_id")
	private Patent patent;
	
	@Column(name="delState",length=20,nullable=false)
	private Integer delState;	//删除状态,1表示已经删除，0表示未删除
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="createTime",nullable=false)
	private Date createTime;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="updateTime",nullable=false)
	private Date updateTime;
	
	@Transient
	private String patentId;

	@Transient
	private Object user;
	

	public String getId() {
		return id;
	}


	public String getFromUserId() {
		return fromUserId;
	}


	public String getFromUserType() {
		return fromUserType;
	}


	public String getContent() {
		return content;
	}


	public Patent getPatent() {
		return patent;
	}


	public Integer getDelState() {
		return delState;
	}


	public Date getCreateTime() {
		return createTime;
	}


	public Date getUpdateTime() {
		return updateTime;
	}


	public String getPatentId() {
		return patentId;
	}


	public Object getUser() {
		return user;
	}


	public void setId(String id) {
		this.id = id;
	}


	public void setFromUserId(String fromUserId) {
		this.fromUserId = fromUserId;
	}


	public void setFromUserType(String fromUserType) {
		this.fromUserType = fromUserType;
	}


	public void setContent(String content) {
		this.content = content;
	}


	public void setPatent(Patent patent) {
		this.patent = patent;
	}


	public void setDelState(Integer delState) {
		this.delState = delState;
	}


	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}


	public void setPatentId(String patentId) {
		this.patentId = patentId;
	}


	public void setUser(Object user) {
		this.user = user;
	}


	@Override
	public String toString() {
		return "Chat [id=" + id + ", fromUserId=" + fromUserId + ", fromUserType=" + fromUserType + ", content="
				+ content + ", patent=" + patent + ", delState=" + delState + ", createTime=" + createTime
				+ ", updateTime=" + updateTime + ", patentId=" + patentId + ", user=" + user + "]";
	}




	
	
	
	
}
